import Vue from 'vue'
import Router from 'vue-router'
import _import from '@/router/_import'
import Layout from '@/views/layout/Layout'

Vue.use(Router)

export const RouterMaps = [
    {
        path: '/',
        component: Layout,
        redirect: '/dashboard',
        name: '首页',
        hidden: true,
    },
    {
        path: '/dashboard',
        component: Layout,
        noDropdown: true,
        children: [
            {path: 'index', component: _import('dashboard/default/index'), name: '控制台'}
        ]
    },
    {
        path: '/car',
        name: '车况管理',
        component: Layout,
        children: [
            {path: 'clxs', component: _import('car/clxs'), name: '车辆新伤'},
            {path: 'ckjl', component: _import('car/ckjl'), name: '车况记录'},
            {path: 'cljc', component: _import('car/cljc'), name: '车辆检查'},
            {path: 'dqjc', component: _import('car/dqjc'), name: '地勤检查'},
            {path: 'clgl', component: _import('car/clgl'), name: '车辆管理'},
            {path: 'dqyhgl', component: _import('car/dqyhgl'), name: '地勤用户管理'}
        ]
    },
    {
        path: '/system',
        name: '系统管理',
        component: Layout,
        children: [
            {path: 'user', component: _import('system/user'), name: '用户管理'},
            {path: 'menu', component: _import('system/menu'), name: '菜单管理'}
        ]
    },
    {
        path: '/lesson-1',
        name: '第一季',
        component: Layout,
        children: [
            {
                path: '/example/table',
                component: _import('lesson1/demo7'),
                name: 'Table',
                children: [
                    {path: 'dynamictable', component: _import('lesson1/demo7'), name: '动态table'},
                    {path: 'dragtable', component: _import('lesson1/demo7'), name: '拖拽table'},
                    {path: 'inline_edit_table', component: _import('lesson1/demo7'), name: 'table内编辑'},
                    {path: 'table', component: _import('lesson1/demo7'), name: '综合table'}
                ]
            },
            {path: 'demo1', component: _import('lesson1/demo1'), name: '第1节'},
            {path: 'demo2', component: _import('lesson1/demo2'), name: '第2节'},
            {path: 'demo3', component: _import('lesson1/demo3'), name: '第3节'},
            {path: 'demo4', component: _import('lesson1/demo4'), name: '第4节'},
            {path: 'demo5', component: _import('lesson1/demo5'), name: '第5节'},
            {path: 'demo6', component: _import('lesson1/demo6'), name: '第6节'},
            {path: 'demo7', component: _import('lesson1/demo7'), name: '第7节'}

        ]
    },
    {
        path: '/errlog',
        component: Layout,
        redirect: 'noredirect',
        name: 'errlog',
        noDropdown: true,
        children: [{path: 'log', component: _import('lesson1/demo5'), name: '错误日志'}]
    }
]

export default new Router({
    routes: RouterMaps
})
